package at.ac.tuwien.ame;

import com.google.common.base.Predicate;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;

/**
 * Filters {@link IProject}s, which contain models.
 */
@SuppressWarnings("all")
public class EcoreModelProjectPredicate implements Predicate<IProject> {
  public boolean apply(final IProject input) {
    boolean _and = false;
    boolean _isOpen = input.isOpen();
    if (!_isOpen) {
      _and = false;
    } else {
      IFolder _folder = input.getFolder("model");
      boolean _exists = _folder.exists();
      _and = (_isOpen && _exists);
    }
    return _and;
  }
}
